//
//  ViewController.m
//  UIScrollView
//
//  Created by liuchengming on 16/10/29.
//  Copyright © 2016年 liuchengming. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    //滚动试图控件初始化
    UIScrollView * sv = [UIScrollView new];
    //控件的大小
    sv.frame = CGRectMake(0, 0, 320, 576);
    //是否按照整页滚动
    sv.pagingEnabled = YES ;
    //是否开启横向滚动
    sv.scrollEnabled = YES ;
    //设置画布大小
    sv.contentSize = CGSizeMake(320*5, 576);
    //是否可以开启边缘弹动
    sv.bounces = YES ;
    //纵向弹动
    sv.alwaysBounceHorizontal = YES ;
    //横向弹动
    sv.alwaysBounceVertical = YES ;
    //横向滚动条
    sv.showsVerticalScrollIndicator = YES ;
    //纵向滚动条
    sv.showsHorizontalScrollIndicator = YES ;
    
    //背景颜色
    sv.backgroundColor = [UIColor blueColor];
    
    
    [self.view addSubview:sv];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
